function toggleBar()
{
	if(document.getElementById("bar_container").style.display=="block" || document.getElementById("bar_container").style.display=="")
	{
		document.getElementById("bar_container").style.display = "none";
		setCookie("floatbottomboxdisplay",1,null);
	}
	else
	{
		document.getElementById("bar_container").style.display = "block";
		setCookie("floatbottomboxdisplay",2,null);
	}
}
var floatbottomboxCurrent = 0;
function initFloatBox()
{
	var floatbottomboxdisplay = getCookie("floatbottomboxdisplay");
	if(!floatbottomboxdisplay) statex = "style='display:block'";
	else { if(floatbottomboxdisplay=="2") statex = "style='display:block'"; else statex = "style='display:none'"; }

	var ax = "<div id='bar_float'><div id='bar_top'><a href='javascript:;' onclick='javascript:toggleBar();'><span>&nbsp;</span></a></div><div id='bar_container' "+statex+"><a href='http://fexbet.com' target='_blank'><span>&nbsp;</span></a></div></div>";
	document.writeln(ax);
	document.writeln('<link rel="stylesheet" type="text/css" href="http://ads.yeuthethao.com/fexbet_popup//barfloat_left.css" />');
	//document.getElementById("bar_container").style.display="block";
	floatbottomboxCurrent=0;
}
function floatbottomboxNext()
{
	if(floatbottomboxCurrent<"2")
	{
		document.getElementById("floatbottombox_ctn_"+floatbottomboxCurrent).style.display="none";
		document.getElementById("floatbottombox_ctn_"+(floatbottomboxCurrent+1)).style.display="block";
		floatbottomboxCurrent = floatbottomboxCurrent+1;
	} else {
		document.getElementById("floatbottombox_ctn_2").style.display="none";
		document.getElementById("floatbottombox_ctn_0").style.display="block";
		floatbottomboxCurrent = 0;
	}
}
function setCookie(c_name,value,expiredays)
{
	var exdate=new Date();
	exdate.setDate(exdate.getDate()+expiredays);
	document.cookie=c_name+ "=" +escape(value)+
	((expiredays==null) ? "" : ";expires="+exdate.toGMTString());
}
function getCookie(c_name)
{
	if (document.cookie.length>0)
	  {
	  c_start=document.cookie.indexOf(c_name + "=");
	  if (c_start!=-1)
	    {
	    c_start=c_start + c_name.length+1;
	    c_end=document.cookie.indexOf(";",c_start);
	    if (c_end==-1) c_end=document.cookie.length;
	    return unescape(document.cookie.substring(c_start,c_end));
	    }
	  }
	return "";
}
initFloatBox();
